import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralProductService = (params) => {
  params.head.transCode = 'queryGeneralProductService';
  return request({
    url: '/general/generalProductService/queryGeneralProductService',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralProductServiceListPage = (params) => {
  params.head.transCode = 'queryGeneralProductServiceListPage';
  return request({
    url: '/general/generalProductService/queryGeneralProductServiceListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralProductService = (params) => {
  params.head.transCode = 'saveGeneralProductService';
  return request({
    url: '/general/generalProductService/saveGeneralProductService',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralProductServiceList = (params) => {
  params.head.transCode = 'saveGeneralProductServiceList';
  return request({
    url: '/general/generalProductService/saveGeneralProductServiceList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralProductService = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralProductService';
  return request({
    url: '/general/generalProductService/saveOrUpdateGeneralProductService',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralProductServiceList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralProductServiceList';
  return request({
    url: '/general/generalProductService/saveOrUpdateGeneralProductServiceList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralProductService = (params) => {
  params.head.transCode = 'updateGeneralProductService';
  return request({
    url: '/general/generalProductService/updateGeneralProductService',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralProductService = (params) => {
  params.head.transCode = 'deleteGeneralProductService';
  return request({
    url: '/general/generalProductService/deleteGeneralProductService',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralProductServiceList = (params) => {
  params.head.transCode = 'deleteGeneralProductServiceList';
  return request({
    url: '/general/generalProductService/deleteGeneralProductServiceList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralProductServiceExcel = (params) => {
  downloadExcel({
    url: '/general/generalProductService/excelDownload/exportGeneralProductServiceExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
